<? $this->title = 'Main page'; ?>
{{wrap with="front_page_layout.phtml" into="content"}}
<h2>Random products from the store</h2>

<? $products = Product :: findForFront()->sort(array('' => 'rand()'))->paginate(0, 3); ?>

{{list using="$products"}}
<table cellpadding="0" cellspacing="0" class='list'>
  <thead>
  </thead>
  {{list:item}}
  <tr>
   <td>
      <dl>
        <dt>
          <b>{$item.title}</b><br />
          Price:<b>${$item.price|number:2, '.', ' '}</b><br/>
          <a href="{{route_url params='controller:cart,action:add,id:{$item.id}'}}">Add to cart</a><br/>
         </dt>
         <dd>
            <img src='{$item.image_path}' class='img'/>
            {$item.description|nl2br}
         </dd>
      </dl>
    </td>
  </tr>
  {{/list:item}}
</table>
{{/list}}

<br/>
{{/wrap}}
